
import jieba

txt= open("sanguo.txt", "r", encoding="utf-8")
content = txt.read()

words = jieba.lcut(content)
result = {}

for word in words:
    if len(word) > 1:
        result[word] = result.get(word, 0) + 1

sorted_result = sorted(result.items(), key=lambda x: x[1], reverse=True)

for word, count in sorted_result:
    print("{}:{}".format(word, count))
